<template>
	<view class="safe-bottom">
		<view class="u-p-x-30 u-p-t-30" style="padding-bottom: 120rpx" >
			<u-parse class="" :html="agreement" style="overflow:hidden;" :tag-style="{ img: 'display: block'}"></u-parse>
		</view>
		<view class="position-fixed left-0 right-0 bottom-0" >
			<view class="flex align-center justify-evenly u-p-b-30">
				<dy-button width="250rpx" size="default" borderColor="#bdbdbd" backgroundColor="#bdbdbd" @click="btn(0)">不同意</dy-button>
				<dy-button width="250rpx" size="default" @click="btn(1)">同意</dy-button>
			</view>
		</view>
	</view>
</template>

<script>
	import { MineCenterApi } from '@/api/serves.js' 
	export default {
		data() {
			return {
				agreement: '',
				type:0,
			};
		},
		onLoad(option) {
			let {type} = option
			this.type = type
			console.log(this.type);
			this._applyIndex()
		},
		methods: {
			_applyIndex() {
				this.$ShowLoading()
				MineCenterApi.applyIndex().then(res => {
				  console.log('入驻协议', res);
					this.$HideLoading()
					if(res.code == 1){
						this.agreement  = res.data.agreement
					}
				})
			},
			btn(index) {
				if(index == 0) return uni.navigateBack()
				console.log(this.type);
				if(this.type == 0){  //去企业认证
					uni.redirectTo({
						url: '/pages/mine/mineEnterPages/mineEnterApply/apply'
					})
				}else{  // 去小微认证
					uni.redirectTo({
						url: '/pages/mine/mineEnterPages/mineEnterApplyXW/apply?type='+this.type
					})
				}
				
			}
		}
	}
</script>

<style lang="scss" scoped>
page {
	background-color: #fff;
}
</style>
